<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>jQuery 属性 | JoMin·个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../../md/css/jQuery/3、正则表达式.html" />
    
    
    <link rel="prev" href="../../../md/css/jQuery/1、选择器和效果.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="10.2"
        data-chapter-title="jQuery 属性"
        data-filepath="md/css/jQuery/2、jQuery属性.md"
        data-basepath="../../.."
        data-revision="Sun Aug 30 2020 17:22:53 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/css/HTML and CSS/1、css 的引入方式.html">
            
                
                    <a href="../../../md/css/HTML and CSS/1、css 的引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML and CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/css/HTML and CSS/3、常用的标签.html">
            
                
                    <a href="../../../md/css/HTML and CSS/3、常用的标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        常用的标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/css/HTML and CSS/4、表格的使用.html">
            
                
                    <a href="../../../md/css/HTML and CSS/4、表格的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        表格的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="md/css/HTML and CSS/5、表单和新增元素.html">
            
                
                    <a href="../../../md/css/HTML and CSS/5、表单和新增元素.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        表单和新增元素
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="md/css/HTML and CSS/6、a 标签的使用.html">
            
                
                    <a href="../../../md/css/HTML and CSS/6、a 标签的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        a 标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="md/css/HTML and CSS/7、盒子模型.html">
            
                
                    <a href="../../../md/css/HTML and CSS/7、盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="md/css/HTML and CSS/8、浮动.html">
            
                
                    <a href="../../../md/css/HTML and CSS/8、浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="md/css/HTML and CSS/9、css 常见问题.html">
            
                
                    <a href="../../../md/css/HTML and CSS/9、css 常见问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        css 常见问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="md/css/HTML and CSS/10、位置定位.html">
            
                
                    <a href="../../../md/css/HTML and CSS/10、位置定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        位置定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="md/css/HTML and CSS/11、阴影设置.html">
            
                
                    <a href="../../../md/css/HTML and CSS/11、阴影设置.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        阴影设置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="md/css/HTML and CSS/12、自定义动画.html">
            
                
                    <a href="../../../md/css/HTML and CSS/12、自定义动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="md/css/HTML and CSS/13、容器居中方法.html">
            
                
                    <a href="../../../md/css/HTML and CSS/13、容器居中方法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.11.</b>
                        
                        容器居中
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="md/css/HTML and CSS/14、fullpage 的使用.html">
            
                
                    <a href="../../../md/css/HTML and CSS/14、fullpage 的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.12.</b>
                        
                        fullpage 的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="img/gitbook的安装.html">
            
                
                    <a href="../../../img/gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        gitbook 的安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/css/移动端/移动端.html">
            
                
                    <a href="../../../md/css/移动端/移动端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        移动端
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/css/移动端/1、关于移动端.html">
            
                
                    <a href="../../../md/css/移动端/1、关于移动端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        关于移动端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/css/移动端/2、移动端小问题.html">
            
                
                    <a href="../../../md/css/移动端/2、移动端小问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        移动端小问题
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/css/flex布局/flex.html">
            
                
                    <a href="../../../md/css/flex布局/flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        flex 弹性盒子
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="md/css/flex布局/1、flex布局.html">
            
                
                    <a href="../../../md/css/flex布局/1、flex布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        flex 布局
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="md/css/响应式布局/bootstrap.html">
            
                
                    <a href="../../../md/css/响应式布局/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        响应式布局
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="md/css/响应式布局/1、Bootstrap.html">
            
                
                    <a href="../../../md/css/响应式布局/1、Bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        Bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="md/css/响应式布局/2、媒体查询.html">
            
                
                    <a href="../../../md/css/响应式布局/2、媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="md/css/JavaScript/JavaScript.html">
            
                
                    <a href="../../../md/css/JavaScript/JavaScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        JavaScript
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="md/css/JavaScript/1、JavaScript数据类型.html">
            
                
                    <a href="../../../md/css/JavaScript/1、JavaScript数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        JS 数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="md/css/JavaScript/2、数据类型的转换.html">
            
                
                    <a href="../../../md/css/JavaScript/2、数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="md/css/JavaScript/3、运算符.html">
            
                
                    <a href="../../../md/css/JavaScript/3、运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="md/css/JavaScript/4、赋值运算符.html">
            
                
                    <a href="../../../md/css/JavaScript/4、赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="md/css/JavaScript/5、比较运算符.html">
            
                
                    <a href="../../../md/css/JavaScript/5、比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="md/css/JavaScript/6、逻辑操作符.html">
            
                
                    <a href="../../../md/css/JavaScript/6、逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="md/css/JavaScript/7、条件运算符.html">
            
                
                    <a href="../../../md/css/JavaScript/7、条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="md/css/JavaScript/8、位运算符.html">
            
                
                    <a href="../../../md/css/JavaScript/8、位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="md/css/JavaScript/9、条件语句.html">
            
                
                    <a href="../../../md/css/JavaScript/9、条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.10" data-path="md/css/JavaScript/10、循环语句.html">
            
                
                    <a href="../../../md/css/JavaScript/10、循环语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.10.</b>
                        
                        循环语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.11" data-path="md/css/JavaScript/11、break和continue.html">
            
                
                    <a href="../../../md/css/JavaScript/11、break和continue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.11.</b>
                        
                        break 和 continue
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.12" data-path="md/css/JavaScript/12、for循环.html">
            
                
                    <a href="../../../md/css/JavaScript/12、for循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.12.</b>
                        
                        for 循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.13" data-path="md/css/JavaScript/13、多层循环.html">
            
                
                    <a href="../../../md/css/JavaScript/13、多层循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.13.</b>
                        
                        多层循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.14" data-path="md/css/JavaScript/14、for-in循环.html">
            
                
                    <a href="../../../md/css/JavaScript/14、for-in循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.14.</b>
                        
                        for-in 循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.15" data-path="md/css/JavaScript/15、try-catch语句.html">
            
                
                    <a href="../../../md/css/JavaScript/15、try-catch语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.15.</b>
                        
                        try-catch 语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.16" data-path="md/css/JavaScript/16、函数.html">
            
                
                    <a href="../../../md/css/JavaScript/16、函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.16.</b>
                        
                        函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.17" data-path="md/css/JavaScript/17、循环排序.html">
            
                
                    <a href="../../../md/css/JavaScript/17、循环排序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.17.</b>
                        
                        循环排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.18" data-path="md/css/JavaScript/18、es6语法.html">
            
                
                    <a href="../../../md/css/JavaScript/18、es6语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.18.</b>
                        
                        es6 语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.19" data-path="md/css/JavaScript/19、数组对象.html">
            
                
                    <a href="../../../md/css/JavaScript/19、数组对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.19.</b>
                        
                        数组对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.20" data-path="md/css/JavaScript/20、date对象.html">
            
                
                    <a href="../../../md/css/JavaScript/20、date对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.20.</b>
                        
                        date 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.21" data-path="md/css/JavaScript/21、Boolean对象.html">
            
                
                    <a href="../../../md/css/JavaScript/21、Boolean对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.21.</b>
                        
                        Boolean 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.22" data-path="md/css/JavaScript/22、数学对象.html">
            
                
                    <a href="../../../md/css/JavaScript/22、数学对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.22.</b>
                        
                        数学对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.23" data-path="md/css/JavaScript/23、对象的创建.html">
            
                
                    <a href="../../../md/css/JavaScript/23、对象的创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.23.</b>
                        
                        对象的创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="md/css/BOM/BOM.html">
            
                
                    <a href="../../../md/css/BOM/BOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        BOM
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="md/css/BOM/1、window对象.html">
            
                
                    <a href="../../../md/css/BOM/1、window对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        window 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="md/css/BOM/2、navigator对象.html">
            
                
                    <a href="../../../md/css/BOM/2、navigator对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        navigator 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="md/css/BOM/3、screen对象.html">
            
                
                    <a href="../../../md/css/BOM/3、screen对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        screen 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="md/css/BOM/4、history对象.html">
            
                
                    <a href="../../../md/css/BOM/4、history对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        history 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="md/css/BOM/5、location对象.html">
            
                
                    <a href="../../../md/css/BOM/5、location对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        location 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="md/css/BOM/6、cookie对象.html">
            
                
                    <a href="../../../md/css/BOM/6、cookie对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        cookie 对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7" data-path="md/css/BOM/7、html5本地存储.html">
            
                
                    <a href="../../../md/css/BOM/7、html5本地存储.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.</b>
                        
                        html5 本地存储
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="md/css/DOM/DOM.html">
            
                
                    <a href="../../../md/css/DOM/DOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        DOM
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="md/css/DOM/1、DOM介绍.html">
            
                
                    <a href="../../../md/css/DOM/1、DOM介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        DOM 介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="md/css/DOM/2、元素对象.html">
            
                
                    <a href="../../../md/css/DOM/2、元素对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        元素对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="md/css/DOM/3、DOM事件1.html">
            
                
                    <a href="../../../md/css/DOM/3、DOM事件1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        DOM 事件 1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="md/css/DOM/4、DOM事件2.html">
            
                
                    <a href="../../../md/css/DOM/4、DOM事件2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        DOM 事件 2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="md/css/DOM/5、移动端事件.html">
            
                
                    <a href="../../../md/css/DOM/5、移动端事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        移动端事件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="md/css/Ajax/Ajax.html">
            
                
                    <a href="../../../md/css/Ajax/Ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        Ajax
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="md/css/Ajax/Ajax的实现过程.html">
            
                
                    <a href="../../../md/css/Ajax/Ajax的实现过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        Ajax 的实现过程
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" data-path="md/css/jQuery/jQuery.html">
            
                
                    <a href="../../../md/css/jQuery/jQuery.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        jQuery
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="10.1" data-path="md/css/jQuery/1、选择器和效果.html">
            
                
                    <a href="../../../md/css/jQuery/1、选择器和效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.1.</b>
                        
                        选择器和效果
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="10.2" data-path="md/css/jQuery/2、jQuery属性.html">
            
                
                    <a href="../../../md/css/jQuery/2、jQuery属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.2.</b>
                        
                        jQuery 属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.3" data-path="md/css/jQuery/3、正则表达式.html">
            
                
                    <a href="../../../md/css/jQuery/3、正则表达式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.3.</b>
                        
                        正则表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.4" data-path="md/css/jQuery/4、选择器和操作.html">
            
                
                    <a href="../../../md/css/jQuery/4、选择器和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.4.</b>
                        
                        选择器和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="11" data-path="md/css/VUE/vue.html">
            
                
                    <a href="../../../md/css/VUE/vue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.</b>
                        
                        VUE
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="11.1" data-path="md/css/VUE/1、绑定class和style.html">
            
                
                    <a href="../../../md/css/VUE/1、绑定class和style.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.1.</b>
                        
                        绑定 class 和 style
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.2" data-path="md/css/VUE/2、绑定表单.html">
            
                
                    <a href="../../../md/css/VUE/2、绑定表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.2.</b>
                        
                        绑定表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.3" data-path="md/css/VUE/3、组件之间的数据传递.html">
            
                
                    <a href="../../../md/css/VUE/3、组件之间的数据传递.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.3.</b>
                        
                        组件之间的数据传递
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.4" data-path="md/css/VUE/4、vue-router.html">
            
                
                    <a href="../../../md/css/VUE/4、vue-router.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.4.</b>
                        
                        vue-router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.5" data-path="md/css/VUE/style样式.html">
            
                
                    <a href="../../../md/css/VUE/style样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.5.</b>
                        
                        style 样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.6" data-path="md/css/VUE/生命周期函数.html">
            
                
                    <a href="../../../md/css/VUE/生命周期函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.6.</b>
                        
                        生命周期函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.7" data-path="md/css/VUE/vue-resource.html">
            
                
                    <a href="../../../md/css/VUE/vue-resource.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.7.</b>
                        
                        vue-resource
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.8" data-path="md/css/VUE/axios.html">
            
                
                    <a href="../../../md/css/VUE/axios.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.8.</b>
                        
                        axios
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.9" data-path="md/css/VUE/vue动画.html">
            
                
                    <a href="../../../md/css/VUE/vue动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.9.</b>
                        
                        vue 动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.10" data-path="md/css/VUE/插槽的使用.html">
            
                
                    <a href="../../../md/css/VUE/插槽的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.10.</b>
                        
                        插槽的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.11" data-path="md/css/VUE/ajax与框架搭建.html">
            
                
                    <a href="../../../md/css/VUE/ajax与框架搭建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.11.</b>
                        
                        ajax 与框架搭建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.12" data-path="md/css/VUE/计算属性VS侦听属性.html">
            
                
                    <a href="../../../md/css/VUE/计算属性VS侦听属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.12.</b>
                        
                        计算属性 VS 侦听属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.13" data-path="md/css/VUE/组件之间数据传递.html">
            
                
                    <a href="../../../md/css/VUE/组件之间数据传递.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.13.</b>
                        
                        组件之间数据传递
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="12" data-path="md/css/阿里巴巴矢量图标库.html">
            
                
                    <a href="../../../md/css/阿里巴巴矢量图标库.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.</b>
                        
                        阿里巴巴矢量图标库
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13" data-path="md/css/ES6/ES6.html">
            
                
                    <a href="../../../md/css/ES6/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.</b>
                        
                        ES6
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="13.1" data-path="md/css/ES6/1、promise.html">
            
                
                    <a href="../../../md/css/ES6/1、promise.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.1.</b>
                        
                        promise
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13.2" data-path="md/css/ES6/2、数组的扩展.html">
            
                
                    <a href="../../../md/css/ES6/2、数组的扩展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.2.</b>
                        
                        数组的扩展
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13.3" data-path="md/css/ES6/3、set的使用.html">
            
                
                    <a href="../../../md/css/ES6/3、set的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.3.</b>
                        
                        set 的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13.4" data-path="md/css/ES6/4、类和类的继承.html">
            
                
                    <a href="../../../md/css/ES6/4、类和类的继承.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.4.</b>
                        
                        类和类的继承
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="14" data-path="md/css/JS、JQ阻止事件冒泡.html">
            
                
                    <a href="../../../md/css/JS、JQ阻止事件冒泡.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.</b>
                        
                        JS、JQ 阻止事件冒泡
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="15" data-path="md/css/微信小程序/微信小程序.html">
            
                
                    <a href="../../../md/css/微信小程序/微信小程序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>15.</b>
                        
                        微信小程序
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../../" >JoMin·个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5C5E;&#x6027;">&#x5C5E;&#x6027;:</h1>
<ul>
<li><p>&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x5C5E;&#x6027;</p>
<ul>
<li><p>1&#x3001;attr(property,val)&#xFF0C;prop(property,val)</p>
<ul>
<li>property&#xFF1A;&#x8868;&#x793A;&#x5C5E;&#x6027;&#x540D;</li>
<li>val:&#x53EF;&#x9009;&#xFF0C;&#x5F53;&#x8BBE;&#x7F6E;&#x4E86;val&#x503C;&#x65F6;&#xFF0C;&#x8868;&#x793A;&#x7528;&#x6765;&#x8BBE;&#x7F6E;&#x8BE5;&#x5C5E;&#x6027;&#x3002;</li>
<li>attr&#x83B7;&#x53D6;&#x5230;&#x7684;&#x5C5E;&#x6027;&#x662F;&#x5199;&#x6B7B;&#x5728;html&#x7ED3;&#x6784;&#x4E0A;&#x7684;&#x503C;&#xFF0C;&#x4E0D;&#x4F1A;&#x968F;&#x7740;&#x590D;&#x9009;&#x6846;&#x7684;&#x72B6;&#x6001;&#x6539;&#x53D8;&#x800C;&#x6539;&#x53D8;</li>
<li>prop&#x83B7;&#x53D6;&#x5230;&#x7684;&#x5C5E;&#x6027;&#x503C;&#x662F;&#x52A8;&#x6001;&#x7684;&#xFF0C;&#x53EF;&#x4EE5;&#x968F;&#x7740;&#x590D;&#x9009;&#x6846;&#x7684;&#x72B6;&#x6001;&#x6539;&#x53D8;&#x800C;&#x6539;&#x53D8;</li>
</ul>
</li>
<li><p>2&#x3001;removeAttr(property):&#x79FB;&#x9664;&#x5143;&#x7D20;&#x5C5E;&#x6027;</p>
<ul>
<li>property&#x8868;&#x793A;&#x9700;&#x8981;&#x79FB;&#x9664;&#x7684;&#x5C5E;&#x6027;</li>
</ul>
</li>
<li><p>3&#x3001;val()&#x83B7;&#x53D6;&#x8868;&#x5355;&#x5143;&#x7D20;&#x503C;</p>
</li>
</ul>
</li>
</ul>
<pre><code>            $(&quot;input[type=checkbox]&quot;).removeAttr(&quot;checked&quot;);
            $(&quot;input[type=checkbox]&quot;).attr(&quot;checked&quot;,false);
            console.log($(&quot;input[type=checkbox]&quot;).prop(&quot;checked&quot;));
            $(&quot;input[type=checkbox]&quot;).change(function(){
                var inp = $(&quot;input[type=checkbox]&quot;).attr(&quot;checked&quot;);
                var inp1 = $(&quot;input[type=checkbox]&quot;).prop(&quot;checked&quot;);
                console.log(inp,inp1);
            })
</code></pre><ul>
<li>&#x539F;&#x751F;&#x83B7;&#x53D6;&#x52A8;&#x6001;&#x7684;&#x590D;&#x9009;&#x6846;&#x72B6;&#x6001;&#x503C;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x539F;&#x751F;&#x5BF9;&#x8C61;&#x52A0;checked<ul>
<li>&#x6BD4;&#x5982;&#xFF1A;var inp = inp.checked;</li>
</ul>
</li>
</ul>
<pre><code>            $(&quot;input[type=checkbox]&quot;)[0].onchange = function(){
                //getAttribute&#x83B7;&#x53D6;&#x5230;&#x7684;&#x662F;&#x4E00;&#x4E2A;&#x9759;&#x6001;&#x5C5E;&#x6027;
                var inp = $(&quot;input[type=checkbox]&quot;)[0].getAttribute(&quot;checked&quot;);
                console.log(inp);
            }
            $(&quot;input[type=checkbox]&quot;)[0].onchange = function(){
                var inp = $(&quot;input[type=checkbox]&quot;)[0].checked;
                console.log(inp);
            }

            var inpT = $(&quot;input[type=text&quot;).val();
            console.log(inpT);
</code></pre><ul>
<li>val(func)&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x8868;&#x5355;&#x5143;&#x7D20;&#x7684;&#x503C;,&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;jq&#x5BF9;&#x8C61;<ul>
<li>func&#xFF1A;&#x8868;&#x793A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x63A5;&#x6536;&#x4E24;&#x4E2A;&#x53C2;&#x6570;(&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x8868;&#x793A;&#x4E0B;&#x6807;&#x503C;,&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x8868;&#x793A;&#x5143;&#x7D20;&#x7684;&#x503C;)</li>
</ul>
</li>
</ul>
<pre><code>            var inpT1 = $(&quot;input[type=text]&quot;).val(function(index,value){
                return index+&quot;+&quot;+value;
            });
            console.log(inpT1);
</code></pre><ul>
<li><p>addClass(property/func):&#x6DFB;&#x52A0;&#x7C7B;&#x540D;</p>
<ul>
<li>property:&#x8868;&#x793A;&#x9700;&#x8981;&#x6DFB;&#x52A0;&#x7684;&#x7C7B;&#x540D;</li>
<li>func:&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x63A5;&#x6536;&#x4E24;&#x4E2A;&#x53C2;&#x6570;(&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x4E3A;&#x4E0B;&#x6807;&#x503C;,&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x5F53;&#x524D;&#x7684;&#x7C7B;&#x540D;)</li>
</ul>
</li>
<li><p>&#x5207;&#x6362;&#x7C7B;&#x540D;&#x7684;&#x6548;&#x679C;</p>
<pre><code>          $(&quot;div&quot;).on(&quot;click&quot;,function(){
              $(&quot;div&quot;).addClass(function(index,currentClass){
              console.log(index,currentClass);
                  var newClass = currentClass==&quot;test&quot;?&quot;chang&quot;:&quot;test&quot;;
                  $(&quot;div&quot;).removeClass(currentClass);
                  return newClass;
              })
          })
</code></pre></li>
<li><p>css()&#x7528;&#x6765;&#x8BBE;&#x7F6E;&#x5143;&#x7D20;&#x6837;&#x5F0F;</p>
</li>
</ul>
<pre><code>            //&#x7528;&#x6CD5;&#x4E00;
//            $(&quot;.test&quot;).css(&quot;background&quot;,&quot;gray&quot;);
            //&#x7528;&#x6CD5;&#x4E8C;
//            $(&quot;.test&quot;).css({
//                &quot;background&quot;:&quot;red&quot;,
//                &quot;opacity&quot;:&quot;.9&quot;
//            })

//                &#x7528;&#x6CD5;&#x4E09;//&#x968F;&#x673A;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x989C;&#x8272;&#x3002;&#x65B9;&#x6CD5;&#x4E00;
//            $(&quot;.test&quot;).css(&quot;background&quot;,function(){
//                var arr = [1,2,3,4,5,6,7,8,9,&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;,&quot;f&quot;];
//                var res = &quot;&quot;;
//                for(var i=0;i&lt;6;i++){
//                    var ram = Math.floor(Math.random()*arr.length);
//                    res += arr[ram];
//                }
//                return (&quot;#&quot;+res);
//            })

                //&#x65B9;&#x6CD5;&#x4E8C;
//            $(&quot;.test&quot;).css(&quot;background&quot;,function(){
//                var res = &quot;&quot;;
//                for(var i=0;i&lt;6;i++){
//                    var ram = Math.floor(Math.random()*16).toString(16);
//                    res += ram;
//                }
//                return (&quot;#&quot;+res);
//            })

            //&#x7528;&#x6CD5;&#x56DB;
//            var i =100;
//            setInterval(function(){
//                i&lt;300?i++:i-=5;
//                $(&quot;.test&quot;).css({
//                    &quot;width&quot;:function(){
//                        return i+&quot;px&quot;
//                    },
//                    &quot;height&quot;:function(){
//                        return i+&quot;px&quot;
//                    }
//                })
//            },1000/60)
</code></pre><ul>
<li>hasClass(),&#x68C0;&#x67E5;&#x5143;&#x7D20;&#x662F;&#x5426;&#x5177;&#x6709;&#x67D0;&#x4E2A;&#x7C7B;&#x540D;(true&#xFF1A;&#x5177;&#x6709;&#x3002;false&#xFF1A;&#x4E0D;&#x5177;&#x6709;)<ul>
<li>removeClass()&#x79FB;&#x9664;&#x67D0;&#x4E9B;&#x7C7B;&#x540D;</li>
</ul>
</li>
</ul>
<pre><code>            console.log($(&quot;div&quot;).hasClass(&quot;test&quot;));
            //&#x4EE5;&#x4E0B;&#x5199;&#x6CD5;&#xFF1A;&#x94FE;&#x5F0F;&#x5199;&#x6CD5;
            $(&quot;div&quot;).removeClass(&quot;test abc fff&quot;).addClass(&quot;chang&quot;);

            $(&quot;div&quot;).removeClass(function(index,classN){
                console.log(index,classN);
                return classN;
            }).addClass(&quot;test&quot;);
</code></pre><ul>
<li>toggleClass()&#x5207;&#x6362;&#x7C7B;&#x540D;</li>
</ul>
<pre><code>            $(&quot;div&quot;).on(&quot;click&quot;,function(){
                $(&quot;div&quot;).toggleClass(function(){
                    return &quot;chang&quot;
                })
            })
</code></pre><h1 id="&#x5C3A;&#x5BF8;">&#x5C3A;&#x5BF8;</h1>
<ul>
<li><p>height(),width()</p>
<ul>
<li>&#x83B7;&#x53D6;&#x5230;&#x7684;&#x662F;&#x5185;&#x5BB9;&#x7684;&#x5BBD;&#x9AD8;&#xFF0C;&#x4E0D;&#x5305;&#x62EC;&#x5185;&#x5916;&#x8FB9;&#x8DDD;&#xFF0C;&#x8FB9;&#x6846;</li>
</ul>
</li>
<li><p>innerHeight(),innerWidth()</p>
<ul>
<li>&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x7684;&#x9AD8;&#x5EA6;&#xFF0C;&#x5305;&#x62EC;&#x5185;&#x8FB9;&#x8DDD;&#xFF0C;&#x4E0D;&#x5305;&#x62EC;&#x8FB9;&#x6846;&#x548C;&#x5916;&#x8FB9;&#x8DDD;</li>
</ul>
</li>
<li><p>outerHeight(),outerWidth()</p>
<ul>
<li>&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x9AD8;&#xFF0C;&#x5305;&#x62EC;&#x5185;&#x8FB9;&#x8DDD;&#x548C;&#x8FB9;&#x6846;&#xFF0C;&#x5F53;&#x4F20;&#x5165;&#x53C2;&#x6570;&#x4E3A;true&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5C31;&#x5305;&#x62EC;&#x4E86;&#x5916;&#x8FB9;&#x8DDD;</li>
</ul>
</li>
</ul>
<pre><code>            console.log($(&quot;.test&quot;).height());
            console.log($(&quot;.test&quot;).width());
            //&#x83B7;&#x53D6;&#x5230;&#x7684;&#x662F;&#x6211;&#x4EEC;&#x5199;&#x6B7B;&#x5728;css&#x4E2D;&#x7684;&#x50CF;&#x7D20;&#x5927;&#x5C0F;
            console.log($(&quot;.test&quot;).css(&quot;height&quot;));
            var numH = $(&quot;.test&quot;).css(&quot;height&quot;);
            var res = numH.slice(0,-2);
            console.log(res)//&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;
            var res1 = parseInt(numH);
            console.log(res1)//&#x6570;&#x5B57;&#x7C7B;&#x578B;

            $(&quot;.test&quot;).on(&quot;click&quot;,function(){
//                $(this).height(100);
                $(this).animate({
                    &quot;height&quot;:&quot;100px&quot;
                },1000)
                console.log($(this).height());
            })
//            $(&quot;.test&quot;).height(function(index,height){
//                console.log(index,height)
//                return 250
//            })

            console.log($(&quot;.test&quot;).innerHeight());
            console.log($(&quot;.test&quot;).innerWidth());

//            $(&quot;.test&quot;).innerHeight(function(index,curHeight){
//                return 200;
//            });

            console.log($(&quot;.test&quot;).outerHeight(true));
            console.log($(&quot;.test&quot;).outerWidth(true));
</code></pre><ul>
<li>&#x4F4D;&#x7F6E;<ul>
<li>offset(): &#x83B7;&#x53D6;&#x5230;&#x5143;&#x7D20;&#x8DDD;&#x79BB;&#x6587;&#x6863;&#x5DE6;&#x4E0A;&#x89D2;&#x7684;&#x8DDD;&#x79BB;&#x503C;</li>
</ul>
</li>
</ul>
<pre><code>            console.log($(&quot;.test&quot;).offset());

            $(window).scroll(function(){
                console.log($(&quot;.test&quot;).offset());//{top: 610, left: 10}
            })
            //&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x5143;&#x7D20;&#x7684;&#x4F4D;&#x7F6E;
            $(&quot;.test&quot;).offset({
                &quot;top&quot;:&quot;200&quot;,
                &quot;left&quot;:&apos;200&apos;
            })

            console.log($(&quot;.test&quot;).offsetParent());//&#x7C7B;&#x540D;&#x4E3A;web&#x7684;div
            console.log($(&quot;.web&quot;).offsetParent());//html
</code></pre><ul>
<li><p>position()</p>
<ul>
<li>&#x53D6;&#x5339;&#x914D;&#x5143;&#x7D20;&#x4E2D;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x5F53;&#x524D;&#x5DE6;&#x8FB9;&#xFF0C;&#x76F8;&#x5BF9;&#x4E8E;offset parent&#x7684;&#x5750;&#x6807;,&#x4E0D;&#x53D7;&#x5916;&#x8FB9;&#x8DDD;&#x5F71;&#x54CD;</li>
</ul>
</li>
<li><p>scrollLeft(),scrollTop():&#x83B7;&#x53D6;&#x5230;&#x5143;&#x7D20;/&#x6587;&#x6863;&#x6EDA;&#x52A8;&#x6761;&#x7684;&#x4F4D;&#x7F6E;</p>
</li>
</ul>
<pre><code>            console.log($(&quot;.one&quot;).position());//{top: 10, left: 10}

            $(&quot;.web&quot;).scroll(function(){
                console.log($(&quot;.web&quot;).scrollLeft());
            });

            $(document).scroll(function(){
                console.log($(document).scrollTop());
            });
</code></pre><ul>
<li><p>data():&#x83B7;&#x53D6;&#x6216;&#x8BBE;&#x7F6E;&#x81EA;&#x5B9A;&#x4E49;&#x5C5E;&#x6027;</p>
</li>
<li><p>removeData()&#xFF0C;&#x5220;&#x9664;&#x81EA;&#x5B9A;&#x4E49;&#x5C5E;&#x6027;&#xFF0C;&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x6216;&#x8005;&#x6570;&#x7EC4;</p>
</li>
</ul>
<pre><code>            $(&quot;.web&quot;).data(&quot;isClick&quot;,&quot;true&quot;);
            console.log($(&quot;.web&quot;).data());
            //&#x539F;&#x751F;&#x65B9;&#x6CD5;&#x8BBE;&#x7F6E;/&#x83B7;&#x53D6;&#x81EA;&#x5B9A;&#x4E49;&#x5C5E;&#x6027;
            //$(&quot;.web&quot;)[0].setAttribute(&quot;data-index&quot;,&quot;0&quot;);
            //console.log($(&quot;.web&quot;)[0].getAttribute(&quot;data-index&quot;));
            //console.log($(&quot;.web&quot;)[0].dataset);


            $(&quot;.web&quot;).data({
                &quot;id&quot;:&quot;12&quot;,
                &quot;text&quot;:&quot;&#x6211;&#x662F;div&quot;
            });
            console.log($(&quot;.web&quot;).data());
            //$(&quot;.web&quot;).removeData(&quot;id&quot;);
            $(&quot;.web&quot;).removeData([&quot;id&quot;,&quot;item&quot;]);
            console.log($(&quot;.web&quot;).data());
</code></pre><h1 id="&#x904D;&#x5386;">&#x904D;&#x5386;</h1>
<pre><code>        &lt;ul class=&quot;list&quot;&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;li&gt;5&lt;/li&gt;
        &lt;/ul&gt;
</code></pre><ul>
<li>eq(index),&#x83B7;&#x53D6;&#x4E0B;&#x6807;&#x503C;&#x4E3A;index&#x7684;jq&#x5BF9;&#x8C61;<ul>
<li>&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x8D1F;&#x6570;&#xFF0C;-1&#x4EE3;&#x8868;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;</li>
</ul>
</li>
</ul>
<pre><code>            var ali = $(&quot;.list li&quot;)
            console.log(ali.eq(2));
            ali.eq(2).css(&quot;color&quot;,&quot;skyblue&quot;);
            ali.eq(-1).css(&quot;color&quot;,&quot;pink&quot;);

            console.log(-0 == 0);//true
</code></pre><ul>
<li>filter():&#x7528;&#x6765;&#x7B5B;&#x9009;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;&#x5143;&#x7D20;</li>
</ul>
<pre><code>            ali.filter(&quot;:odd&quot;).css(&quot;background&quot;,&quot;#eee&quot;);
            //$(&quot;.list li:odd&quot;).css(&quot;background&quot;,&quot;#eee&quot;);
            ali.filter(function(index){
                if(index%2==0){
                    $(this).css(&quot;font-size&quot;,&quot;50px&quot;);
                }
            })
            ali.filter(function(index){
                return index%2!=0
            }).css(&quot;font-size&quot;,&quot;30px&quot;);
            var arr = ali.filter(function(index){
                return index%2!=0
            })
            arr.css(&quot;font-weight&quot;,&quot;bold&quot;);
            console.log(arr);
</code></pre><ul>
<li>map()&#x904D;&#x5386;jq&#x5BF9;&#x8C61;</li>
</ul>
<pre><code>            var res = $(&quot;li&quot;).map(function(index,domEle){
                console.log(index,domEle);
                if(index%2 == 0){
                    return domEle
                }
            })
            console.log(res);
</code></pre><ul>
<li>get(index)&#x83B7;&#x53D6;&#x5230;jQuery&#x5BF9;&#x8C61;&#x5F97;&#x5230;&#x5BF9;&#x5E94;&#x7684;DOM&#x5143;&#x7D20;<ul>
<li>index&#xFF1A;&#x53EF;&#x9009;</li>
</ul>
</li>
</ul>
<pre><code>            var res1 = $(&quot;li&quot;).map(function(index,domEle){
                    return index
            }).get().join(&quot;&quot;);
            console.log(res1)//01234

            $(&quot;li:first&quot;).css(&quot;opacity&quot;,&quot;0.2&quot;).siblings().css(&quot;border&quot;,&quot;1px solid #000&quot;);//siblings()&#xFF1A;&#x83B7;&#x53D6;&#x5230;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x5176;&#x4ED6;&#x5144;&#x5F1F;&#x5143;&#x7D20;
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../../md/css/jQuery/1、选择器和效果.html" class="navigation navigation-prev " aria-label="Previous page: 选择器和效果"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../../md/css/jQuery/3、正则表达式.html" class="navigation navigation-next " aria-label="Next page: 正则表达式"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../../gitbook/app.js"></script>

    
    <script src="../../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.js"></script>
    

    
    <script src="../../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-interactive":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
